/**
 * @Project : algorithm-learning
 * @Author : Ruoyu Wang
 * @User : MyComputer
 * @DateTime : 2024/4/28 22:19
 */

#include <iostream>
#include <vector>

using namespace std;

class Solution {
public:
    int findMiddleIndex(vector<int> &nums) {
        int a[nums.size() + 1];
        a[0] = 0;
        for (int i = 0; i < nums.size(); ++i) {
            a[i + 1] = a[i] + nums[i];
        }
        for (int i = 0; i < nums.size(); ++i) {
            if (a[i] - a[0] == a[nums.size()] - a[i + 1]) return i;
        }
        return -1;
    }
};


int main() {

    return 0;
}